﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TQuestion_List.aspx.cs" Inherits="ExamSystem.qt.TQuestion_List" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>考试管理系统</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<meta name="renderer" content="webkit|ie-comp|ie-stand"/>
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
	<meta http-equiv="Cache-Control" content="no-siteapp" />
	<link rel="icon" href="../icon_txt.gif" type="image/x-icon"/>
    <link rel="stylesheet" type="text/css" href="../h-ui/static/h-ui/css/H-ui.min.css" />
	<link rel="stylesheet" type="text/css" href="../h-ui/static/h-ui.admin/css/H-ui.admin.css" />
	<link rel="stylesheet" type="text/css" href="../h-ui/lib/Hui-iconfont/1.0.8/iconfont.css" />
	<link rel="stylesheet" type="text/css" href="../h-ui/static/h-ui.admin/skin/default/skin.css" id="skin" />
	<link rel="stylesheet" type="text/css" href="../h-ui/static/h-ui.admin/css/style.css" />
    <script type="text/javascript" src="../h-ui/lib/jquery/1.9.1/jquery.min.js"></script> 
	<script type="text/javascript" src="../h-ui/lib/layer/2.4/layer.js"></script>
    <script type="text/javascript" src="../h-ui/static/h-ui/js/H-ui.min.js"></script>
	<script type="text/javascript" src="../h-ui/static/h-ui.admin/js/H-ui.admin.js"></script>
    <script type="text/javascript" src="../h-ui/lib/jquery.contextmenu/jquery.contextmenu.r2.js"></script>
	<!--请在下方写此页面业务相关的脚本-->
	<script type="text/javascript">
        //点击具体试题编号进入相应试题
	    function openQuestion(pagerId, id) {
	        document.location.href="TQuestion_List.aspx?id="+pagerId+"&paramQuestionId="+id;
	    }
        //选择答案后保存答案
	    function checkOption(){
	        var answer = "";
	        var ops = document.getElementsByName("tqOption");
	        for(var i=0;i<ops.length;i++){
	            if(ops[i].checked){
	                answer +=ops[i].value;
	            }
	        }
	        if(document.getElementById("answer").value != answer){
	            document.getElementById("answer").value = answer;
	        }
	    }
	    function IsCommit(id){
	        layer.confirm('确认提交试卷吗？',{icon:0},  function(){
	                document.location.href="TQuestion_List.aspx?op=commit&id="+id
	            });
	    }
	</script>
    <style>
        .radio{
            width:20px;
            height:20px;
           
        }
    </style>
</head>
<body>
   <form id="form1" runat="server">
        <div>
            <header class="navbar-wrapper" >
		        <div class="navbar navbar-fixed-top" style="background-color:orange">
			        <div class="container-fluid cl">
				        <a class="logo navbar-logo f-l mr-10 hidden-xs" href="javascript:void(0)">考试管理系统</a> 
				        <span class="logo navbar-slogan f-l mr-10 hidden-xs">v1.0</span> 
				        <nav id="Hui-userbar" class="nav navbar-nav navbar-userbar hidden-xs">
					        <ul class="cl">
						        <li>学生</li>
						        <li class="dropDown dropDown_hover">
							        <a href="#" class="dropDown_A"><label id="lbUname" runat="server" /> <i class="Hui-iconfont">&#xe6d5;</i></a>
							        <ul class="dropDown-menu menu radius box-shadow">
								        <li><a href="javascript:;" onclick="document.location.href='Login.aspx'">退出</a></li>
							        </ul>
						        </li>
					        </ul>
				        </nav>
			        </div>
		        </div>
	        </header>
            <div class="page-container">
                <div class="cl pd-5 bg-1 bk-gray mt-20">
                    <table class="table table-border table-bordered table-bg table-hover table-sort">
                            <thead>
					            <tr class="text-c">
						            <th width="40%">试题名</th>
						            <th width="15%">开始时间</th>
						            <th width="15%">结束时间</th>
						            <th width="10%">满分</th>
						            <th width="10%">题量</th>
						            <th width="10%">操作</th>
					            </tr>
				            </thead>
                              <tr class="text-c">
						                <td><label runat="server" id="lbTpName" /></td>
						                <td><label runat="server" id="lbTpBeginTime" /></td>
						                <td><label runat="server" id="lbTpEndTime" /></td>
						                <td><label runat="server" id="lbTpScore" /></td>
						                <td><label runat="server" id="lbTpCount" /></td>
                                        <td><input type="button" class="btn btn-primary radius" onclick="IsCommit(<%=Request.QueryString["id"]%>)" value="  提交试卷  "/></td>
                                </tr>
                    </table>
                </div>

                <div class="cl pd-5 bg-1 bk-gray mt-20">
                    <div style="width:30%;float:right;background-color:navajowhite;padding-top:20px;padding-bottom:20px">
                        <center>
                            <input type="button" class="btn btn-primary radius" style="width:40px;"  />已答&nbsp;&nbsp;&nbsp;&nbsp;
                            <input type="button" class="btn btn-primary radius" style="width:40px;background-color:gray"  />未答&nbsp;&nbsp;&nbsp;&nbsp;
                            <input type="button" class="btn btn-primary radius" style="width:40px;background-color:yellowgreen"  />当前<br /><br />
                        </center> 
                        <div style="margin-left:5%;">           
                        <%
                            for (int i = 0; i < list.Count;i++ )
                            {
                                ExamSystem.Mdeol.Tanswer ta = list[i];
                                string bgcolor = "";
                                if(this.currentDateIndex.Value==i+"")
                                {
                                    bgcolor = "background-color:yellowgreen";
                                }
                                else if (string.IsNullOrEmpty(ta.TaAnswer))
                                {
                                    bgcolor = "background-color:gray";
                                }
                           
                             %>
                                    
                                    <input type="button" class="btn btn-primary radius" style="width:40px;<%=bgcolor%>" 
                                        value="<%=i+1 %>" " onclick="openQuestion(<%=Request.QueryString["id"]%>,<%=ta.TqId.TqId%>)" />
                                    &nbsp;&nbsp;&nbsp;&nbsp;
                            <%
                                if(i-1%5==0)
                                {
                                    Response.Write("<br/><br/>");
                                }
                            }
                                 %>
                        </div>
                    </div>

                    <div style="width:60%;float:right;margin-right:8%;">
                     
                        <div class="row cl">
				            <div class="formControls col-xs-8 col-sm-9">
                                <pre><%=int.Parse(this.currentDateIndex.Value)+1 %><%=tanswer.TqId.TqName %></pre>
				            </div>
			            </div>
			            <div class="row cl" style="margin-top:10px">
                            <div class="formControls col-xs-8 col-sm-9">
                                <input id="A" type="<%=tanswer.TqId.Tqtype=="单选"?"radio":"checkbox" %>" class="radio" onclick="checkOption()" value="A" name="tqOption" <%=tanswer.TaAnswer.Contains("A")?"checked":"" %>/>
                                <label for="A">A.&nbsp;&nbsp;<%=tanswer.TqId.TqA %></label> 
                            </div>
			            </div>
			            <div class="row cl" style="margin-top:10px">
				            <div class="formControls col-xs-8 col-sm-9">
                                <input id="B" type="<%=tanswer.TqId.Tqtype=="单选"?"radio":"checkbox" %>" class="radio" onclick="checkOption()" value="B" name="tqOption" <%=tanswer.TaAnswer.Contains("B")?"checked":"" %> />
                                <label for="B">B.&nbsp;&nbsp;<%=tanswer.TqId.TqB %></label> 
                            </div>
			            </div>
                        <div class="row cl" style="margin-top:10px">
				            <div class="formControls col-xs-8 col-sm-9">
                                <input id="C" type="<%=tanswer.TqId.Tqtype=="单选"?"radio":"checkbox" %>" class="radio" onclick="checkOption()" value="C" name="tqOption" <%=tanswer.TaAnswer.Contains("C")?"checked":"" %> />
                                <label for="C">C.&nbsp;&nbsp;<%=tanswer.TqId.TqC %></label> 
                            </div>
			            </div>
                        <div class="row cl" style="margin-top:10px">
				            <div class="formControls col-xs-8 col-sm-9">
                                <input id="D" type="<%=tanswer.TqId.Tqtype=="单选"?"radio":"checkbox" %>" class="radio" onclick="checkOption()" value="D" name="tqOption"  <%=tanswer.TaAnswer.Contains("D")?"checked":"" %>/>
                                <label for="D">D.&nbsp;&nbsp;<%=tanswer.TqId.TqD %></label> 
                            </div>
			            </div>
                        <div class="row cl" style="margin-top:20px">
                            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                                 <!-- 当前试题ID -->
                                <input type="hidden" runat="server" id="currentDateIndex" value="0" />
                                <!-- 答案-->
                                <input type="hidden" runat="server" id="dataCount" value="0"/>
                                <!-- 当前试题ID -->
                                <input type="hidden" runat="server" id="currentId" value="" />
                                <!-- 答案-->
                                <input type="hidden" runat="server" id="answer" value=""/>


                                <asp:Button ID="btnLast" runat="server" CssClass="btn btn-primary radius" Text="  上一题  " OnClick="btnLast_Click" />&nbsp;&nbsp;&nbsp;&nbsp;
                                <asp:Button ID="btnNext" runat="server" CssClass="btn btn-primary radius" Text="  下一题  " OnClick="btnNext_Click" />
                            </div>
                        </div>
               
                    </div>
                    
                </div>
            </div>
        </div>
    </form>
</body>
</html>
